import axios from "axios";

//使用axios.create()创建一个axios实例，该实例与axios几乎一致
//可以在创建实例时设置baseUrl
export const host = process.env.NODE_ENV === 'development' ? 'http://192.168.0.121:3000' : 'http://192.168.0.121:3000'
const request = axios.create({
    baseURL: host +'/api',
    timeout: 1000,
    //指定请求头
    // headers: {'X-Custom-Header': 'foobar'}
});

export default request